7.1 Logging Microsoft components

The logging for the REST and authentication services controlled by the Log.config file reports activity within MyID components; however, there may be instances within those logs where errors are reported from Microsoft components. If you require further information about these Microsoft errors, you can add extra logging for these components to provide information on issues deeper in the stack (for example, JWT validation failures, or ASP.net infrastructure issues).

To enable this logging:

  1. In a text editor, open the appsettings.Production.json file for the web service.

    C:\Program Files\Intercede\MyID\<web service name>\appsettings.Production.json

    where <web service name> is the name of the web service.

    These files are the override configuration files for the appsettings.json files for the web services. If these files do not already exist, you must create them in the same folder as the appsettings.json files.

  2. Add an entry for logging Microsoft components.

    For example:

    {
        "Logging":  {
            "LogLevel":  {
                "Microsoft": "Error"
            }
        }
    }

    Note: If you already have appsettings.Production.json files, add the Logging:LogLevel:Microsoft section to the existing file. The above example assumes that there are no other entries in the file.

    This example adds logging information from all Microsoft components at Error level. You are recommended to use this level for diagnosing issues; this level provides useful information without providing too much additional detail that can mask the information you need.

    The supported log levels are different from the values in the Log.config file. From most detail to least, the options are:

    Trace

    Debug

    Information

    Warning

    Error

    Critical

    None

Note: You must make sure that the Log.config file is configured to produce a log (see section 7, MyID REST and authentication web services), or the additional Microsoft logging information will not be logged.

For more information, search for the Logging in .NET Core and ASP.NET Core article on the Microsoft website.